import sys
import time

from watchdog.observers import Observer

try:
    from main import watch_directory
except:
    import watch_directory

try:
    from main import config_util
except:
    import config_util

# observer = Observer()
# event_handler = watch_directory.FileEventHandler()
# if config_util.getConfig("file_target","is_parent_path") == "True":
#     path = sys.argv[1] if len(sys.argv) > 1 else '.'
# else:
#     path = config_util.getConfig("file_target","directory_path")
#
# observer.schedule(event_handler, path, True)
# observer.start()
# print("开始监控目录：{path}".format(path=path))
# try:
#     while True:
#         time.sleep(1)
# except KeyboardInterrupt:
#     observer.stop()
# observer.join()
